export default function findMatchParent(dom: HTMLElement, selector: string) {
  let target: HTMLElement | null = dom;
  while (target) {
    if (target.matches(selector)) {
      return target;
    }
    target = target.parentElement;
  }
  return null;
}
